﻿using System;



public delegate void Handler(object sender, EventArgs e);

public class EventArgs
{
    public string message { get; set; }
}
public class Clock
{
    public event Handler onclick;
    public event Handler onalarm;

    protected void Click(string messg)
    {

        EventArgs args = new EventArgs { message = messg };
        onclick(this, args);
    }

    protected void Alarm(string messg)
    {

        EventArgs args1 = new EventArgs { message = messg };
        onalarm(this, args1);
    }

    public void run()
    {
        for (int i = 0; i < 10; i++)
        {
            this.Click("clicking " + i + "\n");

            System.Threading.Thread.Sleep(1000);
        }
        this.Alarm("alarming " + "\n");
    }
}
public class Program
{
    public static void Main(string[] args)
    {
        Clock clock = new Clock();
        clock.onalarm += (sender, e) =>
        {
            Console.WriteLine($"alarm event :{e.message}");
        };
        clock.onclick += (sender, e) =>
        {
            Console.WriteLine($"click event :{e.message}");
        };

        clock.run();
    }
}



